package com.fdd.spring.aop.homework;

import org.springframework.stereotype.Component;

@Component
public class MyCal implements Cal{
    @Override
    public int cal1(int n) {
        int res = 1;
        for (int i = 1; i <= n; i++) {
            res += i;
        }
        System.out.println("方法内部打印result = " + res);
        return res;
    }

    @Override
    public int cal2(int n) {
        int res = 1;
        for (int i = 1; i <= n; i++) {
            res *= i;
        }
        System.out.println("方法内部打印result = " + res);
        return res;
    }
}
